import matplotlib
import datetime
import paras

matplotlib.use('Agg')


def update(dbname="FX", symbol="FXUSDJPY", qt_type=5):
    import autocode_torch
    autocode_torch.autocode(dbname, symbol, qt_type)
    import LSTM
    paras.dbname = dbname
    paras.symbol = symbol
    paras.qt_type = qt_type
    LSTM.updatemodel(dbname, symbol, qt_type)
    print("%s - %d  end" % (symbol, qt_type), '   at:', datetime.datetime.now())

    # torchRnnShow.showRnn()


if __name__ == '__main__':
    update("FX", "FXGBPJPY", 5)
    # for qt_type in [5, 1]:
    #     for symbol in ["FXUSDJPY", "FXEURUSD", "FXGBPUSD", "FXAUDUSD", "FXNZDUSD", "FXUSDCAD", "FXEURJPY", "FXEURGBP",
    #                    "FXAUDJPY", "FXUSDCHF", "FXEURCHF", "FXCADCHF", "FXGBPJPY"]:
    #         update(symbol, qt_type)
